﻿namespace Example.Creational.Builder
{
    public sealed class LedgerResultBuilder : ResultBuilder
    {
        public LedgerResultBuilder()
            : base(new Ledger())
        {
        }

        public override void Add(decimal value)
        {
            var ledger = (Ledger)Result;
            ledger.Append(value);
        }

        public override void Subtract(decimal value)
        {
            var ledger = (Ledger)Result;
            ledger.Append(value * -1);
        }
    }
}